package org.wxd.category.bootstrap;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description: 服务启动器
 * @Copyright: Copyright 2012 ShenZhen DSE Corporation
 * @Company: 深圳市东深电子股份有限公司
 * @Author : wangxd
 * @Date: 2015-11-5
 * @Version 1.0
 */

public class CategoryServeBootstrap {
    public static ClassPathXmlApplicationContext applicationContext;

    public static void start() {
        applicationContext = new ClassPathXmlApplicationContext(new String[]{"META-INF/application.xml"});
        applicationContext.start();
    }

    public static void main(String[] args) throws Exception{
        /*启动dubbo*/
        new Thread(new Runnable() {
            @Override
            public void run() {
                com.alibaba.dubbo.container.Main.main(null);
            }
        }).start();

        /*启动服务*/
        CategoryServeBootstrap.start();
        System.out.println("category serve start......");
//        com.alibaba.dubbo.container.Main.main(null);
        System.in.read();
    }

    private CategoryServeBootstrap(){}
}
